how to handle state with usestate